package com.zr.util;

import org.springframework.core.convert.converter.Converter;

import java.text.SimpleDateFormat;
import java.util.Date;

public class StringToDate implements Converter<String, Date> {

    @Override
    public Date convert(String s) {
        Date date=null;
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        try {
           date= sdf.parse(s);
        }catch (Exception e){
            e.printStackTrace();
        }
        return date;
    }
}
